<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="buscar_form" acceptcharset="utf-8"> 
                  <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexEmolumento.xhtml')}" value="Emolumentos" update="@form" immediate="true"/> >
                    <p:commandLink  value="Pesquisar Emolumento" update="@form" immediate="true"/>
                </div>
                <p:panel header="Pesquisar Emolumento">
                    <p:growl showDetail="true"  id="msg" life="2000" /> 
                    <h:panelGrid columns="2" id="panelGridEscolha" styleClass="textAlignRight" columnClasses="textAlignRight">
                        <h:outputText value="Descrição : " />
                        <p:inputText  value="#{managerVisualizarEmolumento.emolumento.descricao}" size="30"/>
                        <h:outputText value="Data Vigor:"/>
                        <p:calendar value="#{managerVisualizarEmolumento.emolumento.datVigor}"  mode="popup" showOn="both" pattern="dd/MM/yyyy" />
                     </h:panelGrid> 
                    <div class="buttonAction">
                        <p:commandButton value="Buscar" icon="ui-icon-search" actionListener="#{managerVisualizarEmolumento.buscar()}" update="@form, emolTable, msg"/>
                        <p:commandButton id="limpar" icon="ui-icon-arrowreturnthick-1-w" value="Cancelar" actionListener="#{managerEmolumento.redirect('indexEmolumento.xhtml')}" immediate="true" />
                    </div>
                    
                    <p:dataTable id="emolTable" var="emo" value="#{managerVisualizarEmolumento.emolumentosPesquisa}" 
                                 paginator="true" rows="5"
                                 paginatorPosition="bottom"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                 rowsPerPageTemplate="5,10,15"
                                 emptyMessage="Nenhum Registro Encontrado">    

                        <f:facet name="header">  
                            Dados Emolumento  
                        </f:facet>

                        <p:column  style="width:600px;">  
                            <f:facet name="header" >   
                                Descrição
                            </f:facet>  
                            <h:outputText value="#{emo.descricao}"   />  
                        </p:column>

                        <p:column  style="width:300px;">  
                            <f:facet name="header" >   
                                Data Vigor
                            </f:facet>  
                            <h:outputText value="#{emo.datVigor}" >
                                <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss"/>
                            </h:outputText>  
                        </p:column>
                        <p:column  style="width:100px;">  
                            <f:facet name="header" >   
                                Valor Selo
                            </f:facet>  
                            <h:outputText value="#{emo.valorSelo}"  />  
                        </p:column>


                        <p:column style="width:90px;">  
                            <f:facet name="header">  
                                <h:outputText value="Opções" />   
                            </f:facet>
                            <p:commandButton  icon="editar" actionListener="#{managerEditarEmolumento.redirect('editarEmolumento.xhtml',emo)}" update="@form"/> 
                            <p:commandButton  icon="view" actionListener="#{managerVisualizarEmolumento.redirect('visualizarEmolumento.xhtml',emo)}" update="@form"/> 

                        </p:column>

                    </p:dataTable> 
                    
                </p:panel>
                <br/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
